import request from "src/utils/request"; // 添加拦截器

/**
 * 前端接口
 * @param {*} url：
 */
// 增加一条装置类型的信息
export function addProperty(data) {
  return request({
    url: "/organizer/equipments/",
    method: "post",
    data,
  });
}

// 修改一条装置类型的信息
export function redactProperty(id, data) {
  return request({
    url: `/organizer/equipments/${id}/`,
    method: "patch",
    data,
  });
}

// 查询装置类型的列表信息
export function getTableListTwo(query) {
  return request({
    url: "/organizer/equipments/list/",
    method: "get",
    params: query,
  });
}

// 获取一条装置类型的列表信息
export function particulars(query) {
  return request({
    url: "/organizer/equipments/",
    method: "get",
    params: query,
  });
}

// 删除一条装置类型的信息
export function deleteList(id) {
  return request({
    url: `/organizer/equipments/${id}/`,
    method: "delete",
  });
}

// 查询是否有关联的传感器
export function getcorrelation(query) {
  return request({
    url: "/organizer/equipments/device/list/",
    method: "get",
    params: query,
  });
}

// 增加一条机器装置与传感器设备关联的信息
export function addcorrelation(data) {
  return request({
    url: "/organizer/equipments/device/",
    method: "post",
    data,
  });
}

// 删除一条机器装置与传感器设备关联的信息
export function deletacorrelation(id) {
  return request({
    url: `/organizer/equipments/device/${id}/`,
    method: "delete",
  });
}

// 修改一条机器装置与传感器设备关联的信息
export function redactcorrelation(id, data) {
  return request({
    url: `/organizer/equipments/device/${id}/`,
    method: "patch",
    data,
  });
}

// 获取传感器信息
export function featchDevicesFacility(query) {
  return request({
    url: "/device-mang/devices/list/",
    method: "get",
    params: query,
  });
}

// 获取其他参数显示
export function getElseDate(query) {
  return request({
    url: "/device-mang/devices/params/",
    method: "get",
    params: query,
  });
}

// 获取硬件参数
export function getyjcs(data) {
  return request({
    url: "/device-mang/devices/params/update/",
    method: "post",
    data,
  });
}

export function getyjcsTwo(query) {
  return request({
    url: "/device-mang/devices/params/update/",
    method: "get",
    params: query,
  });
}

// 修改硬件参数
export function amendYjcs(data) {
  return request({
    url: "/device-mang/devices/params/",
    method: "patch",
    data,
  });
}

// 批量导出资产装置的信息
export function exportEquipments(query) {
  return request({
    url: "/organizer/equipments/batch/",
    method: "get",
    params: query,
  });
}

// 批量导人资产装置的信息
export function importEquipments(data) {
  return request({
    url: "/organizer/equipments/batch/",
    method: "post",
    data,
  });
}

// 获取资产用户关注列表一条记录
export function getEquip(query) {
  return request({
    url: "/organizer/concern/equip/",
    method: "get",
    params: query,
  });
}

// 修改告资产用户关注列表一条记录
export function gzRquip(data) {
  return request({
    url: "/organizer/concern/equip/",
    method: "patch",
    data,
  });
}

// 配置算法参数验证
export function dubbing(data) {
  return request({
    url: "/bms-mang/alg/verify/",
    method: "post",
    data,
  });
}

// 查询设备通道的原始数据列表
export function getSourceList(query) {
  return request({
    url: "/bms-mang/alg/source/list/",
    method: "get",
    params: query,
  });
}

// 查询设备通道的原始详细数据
export function getSourceDataList(query) {
  return request({
    url: "/bms-mang/alg/source/data/",
    method: "get",
    params: query,
  });
}

// 获取设备是否在线的信息
export function getOnline(query) {
  return request({
    url: "/device-mang/devices/online/",
    method: "get",
    params: query,
  });
}

// 查询传感器分析详细数据
export function getRawData(query) {
  return request({
    url: "/analysis-mang/analysis-item/raw-data/",
    method: "get",
    params: query,
  });
}

// 获取设备硬件参数页面元素
export function getDynamic(query) {
  return request({
    url: "/device-mang/devices/dynamic/page/",
    method: "get",
    params: query,
  });
}

// 获取设备硬件参数数据
export function getDynamicParam(data) {
  return request({
    url: "/device-mang/devices/dynamic/params/",
    method: "post",
    data,
  });
}

// 获取设备硬件参数数据
export function getDynamicUpdate(data) {
  return request({
    url: "/device-mang/devices/dynamic/update/",
    method: "post",
    data,
  });
}

// 算法参数--参数验证
export function getTry(data) {
  return request({
    url: "/bms-mang/alg/verify2/",
    method: "post",
    data,
  });
}